package singleton.myself.register;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class ContainerSingleton {
    public static  Map<String,Object> ioc =new ConcurrentHashMap<>();

    public static Object getInstance(String className) throws Exception{

        if(!ioc.containsKey(className)){
            ioc.put(className,Class.forName(className));
        }
        return ioc.get(className);
    }
}
